import http from "http"
import pblic from "./pblic"
import queryData from "./queryData"
import publicText from "./publicText"
import err from "./err_404"



const server = http.createServer((req, res) => {
    console.log("8080服务器接收到了");
    queryData(req, res, () => {
       
        if (pblic(req, res)) return;
      
        //判断请求方式
        if(publicText(req, res,req.method))return;
        err(req, res)
    })

})
server.listen(8080, () => {
    console.log("8080服务器启动");
})